home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Animation How-To
/
Animation How-to CD.iso
/
PLY
/
CHAPTER5
/
BROWNIAN
/
BROWNIAN.PI
next >
Wrap
Text File
|
1994-01-01
|
3KB
|
88 lines
// BROWNIAN.PI
// Brownian Random Number Generator
//
// By observation, brownian shifts a vector by
// plus or minus 0.1, so applying brownian to
// a vector <0.1,0.1,0.1> and then multiplying
// it by 5 gives vector components ranging from
// 0 to 1, just like RND.
start_frame 0
end_frame 25
total_frames 25
outfile brown
include "\ply\colors.inc"
viewpoint {
from <2.5,2.0,1.5>
at <0,0,0>
up <0,1,0>
angle 35
resolution 160,100
aspect 1.43
}
background SkyBlue
spot_light white, < 5, 0.5, 0.5>, <0.5,0.5,0.5>,3,15,25 // x
spot_light white, < 0.5, 5, 0.5>, <0.5,0.5,0.5>,3,15,25 // y
spot_light white, < 0.5, 0.5, 5>, <0.5,0.5,0.5>,3,15,25 // z
//object { cylinder < 5, 0.55, 0.55>, <0.5,0.5,0.5>,0.01 matte_black }
//object { cylinder < 0.55, 5, 0.55>, <0.5,0.5,0.5>,0.01 matte_black }
//object { cylinder < 0.55, 0.55, 5>, <0.5,0.5,0.5>,0.01 matte_black }
define v01 [5*brownian(<0.1,0.1,0.1>)]
define v02 [5*brownian(<0.1,0.1,0.1>)]
define v03 [5*brownian(<0.1,0.1,0.1>)]
define v04 [5*brownian(<0.1,0.1,0.1>)]
define v05 [5*brownian(<0.1,0.1,0.1>)]
define v06 [5*brownian(<0.1,0.1,0.1>)]
define v07 [5*brownian(<0.1,0.1,0.1>)]
define v08 [5*brownian(<0.1,0.1,0.1>)]
define v09 [5*brownian(<0.1,0.1,0.1>)]
object {sphere <v01[0][0],v01[0][1],v01[0][2]>,0.05 shiny_red }
object {sphere <v02[0][0],v02[0][1],v02[0][2]>,0.05 shiny_red }
object {sphere <v03[0][0],v03[0][1],v03[0][2]>,0.05 shiny_red }
object {sphere <v04[0][0],v04[0][1],v04[0][2]>,0.05 shiny_red }
object {sphere <v05[0][0],v05[0][1],v05[0][2]>,0.05 shiny_red }
object {sphere <v06[0][0],v06[0][1],v06[0][2]>,0.05 shiny_red }
object {sphere <v07[0][0],v07[0][1],v07[0][2]>,0.05 shiny_red }
object {sphere <v08[0][0],v08[0][1],v08[0][2]>,0.05 shiny_red }
object {sphere <v09[0][0],v09[0][1],v09[0][2]>,0.05 shiny_red }
define a01 < 1, 1, 1>
define a02 < 1, 1, 0>
define a03 < 1, 0, 0>
define a04 < 1, 0, 1>
define a05 <0, 1, 1>
define a06 <0, 1, 0>
define a07 <0, 0, 0>
define a08 <0, 0, 1>
object { cylinder a01,a02,0.02 matte_black }
object { cylinder a02,a03,0.02 matte_black }
object { cylinder a03,a04,0.02 matte_black }
object { cylinder a04,a01,0.02 matte_black }
object { cylinder a05,a06,0.02 matte_black }
object { cylinder a06,a07,0.02 matte_black }
object { cylinder a07,a08,0.02 matte_black }
object { cylinder a08,a05,0.02 matte_black }
object { cylinder a01,a05,0.02 matte_black }
object { cylinder a02,a06,0.02 matte_black }
object { cylinder a03,a07,0.02 matte_black }
object { cylinder a04,a08,0.02 matte_black }
object { polygon 4, a05,a06,a07,a08 matte_white}
object { polygon 4, a03,a07,a08,a04 matte_white}
object { polygon 4, a02,a06,a07,a03 matte_white}